Efficient Single Writer Concurrency

نویسندگان

  • Naama Ben-David
  • Guy E. Blelloch
  • Yihan Sun
  • Yuanhao Wei
چکیده

In this paper we consider single writer multiple reader concurrency—any number of transactions can atomically access shared data structures, but only one thread can atomically update the data. Limiting ourselves to a single writer allows us to achieve strong properties, some of which are not achievable with multiple writers. In particular, we guarantee strict serializability, no aborts, wait-freedom with strong bounds on step complexity, and precise garbage collection. Even with a single writer, achieving many of these properties is non-trivial. Our approach is based on a variant of multiversion concurrency control. In particular, the user code accesses shared data in a purely functional manner, which does not support modifying existing data. This allows each read to get a snapshot of the current database. The writer simply swaps in a new root in order to commit a new version. For garbage collection, we define the version maintenance problem and present efficient algorithms that solve it. This framework allows for very low overhead for maintaining and collecting multiple versions. The single-writer setup is particularly applicable to search indices, online graph analysis, and hybrid transactional/analytical processing (HTAP) databases, in which the bulk of the work is done by transactions that analyze the data. We have implemented the approach in C++ based on a parallel library PAM on balanced binary trees. We present results for two use cases. The first is doing concurrent range-sum queries on a database while new elements are continually added to it. The second is a search index on a corpus, which also supports adding new documents to the database. Experiments show that in both cases there is very little overhead when adding a single writer running in the background, while the queries can gradually get newly updated versions. Also, using our lock-free algorithm for version maintenance, the maximum live versions is bounded by the number of working transactions at the same time.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Model for Concurrency Using Single-Writer Single-Assignment Variables

This paper describes a model for concurrent computation based on single-writer single-assignment variables. The description is primarily graphical, resembling the interaction nets formalism. The model embodies rules in a process which may require two or more communications from other processes to respond. However, these are managed by a partial evaluation response on receiving a single communic...

متن کامل

The Ordering Requirements of Relativistic and Reader-Writer Locking Approaches to Shared Data Access

The semantics of reader-writer locks allow read-side concurrency. Unfortunately, the locking primitives serialize access to the lock variable to an extent that little or no concurrency is realized in practice for small critical sections. Relativistic programming is a methodology that also allows readside concurrency. Relativistic programming uses different ordering constraints than reader-write...

متن کامل

A Comparison of Relativistic and Reader-Writer Locking Approaches to Shared Data Access

This paper explores the relationship between reader-writer locking and relativistic programming approaches to managing accesses to shared data. It demonstrates that by placing certain restrictions on writers, relativistic programming allows more concurrency than reader-writer locking while still providing the same isolation guarantees. Relativistic programming also allows for a straightforward ...

متن کامل

Improving Wait-Free Algorithms for Interprocess Communication in Embedded Real-Time Systems

Concurrency management is a basic requirement for interprocess communication in any multitasking system. This usually takes the form of lock-based or other blocking algorithms. In real-time and/or time-sensitive systems, the less-predictable timing behavior of lock-based mechanisms and the additional task-execution dependency make synchronization undesirable. Recent research has provided non-bl...

متن کامل

Step Optimal Implementations of Large Single-Writer Registers

We present two wait-free algorithms for simulating an `-bit single-writer register from k-bit single-writer registers, for any k ≥ 1. Our first algorithm has Θ(`/k) step complexity for both Read and Write and uses Θ(4`−k) registers. An interesting feature of the algorithm is that Read operations do not write to shared variables. Our second algorithm has Θ(`/k+ (logn)/k) step complexity for both...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2018